<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:insert="~{include :: header('邀请人列表列表')}" />
    <th:block th:insert="~{include :: bootstrap-table-css}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
    <input type="hidden" id="userId" th:value="${userId}">
    <table id="bootstrap-table" class="table-striped"></table>
</div>
<th:block th:insert="~{include :: footer}" />
<th:block th:insert="~{include :: bootstrap-table-js}" />
<script th:inline="javascript">
    var userReg = [[${@dict.getType('qdx_user_register')}]];
    var userId = $("#userId").val();
    $(function() {
        var options = {
            url: "/user/record/list.json?userId=" + userId,
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            modalName: "邀请人列表",
            columns: [
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'userId',
                    title: '邀请人id'
                },
                {
                    field: 'inviteUserId',
                    title: '被邀请人id'
                },
                {
                    field: 'inviteUserName',
                    title: '被邀请人昵称'
                },
                {
                    field: 'registerFrom',
                    title: '被邀请人注册来源',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(userReg, value);
                    }
                },
                {
                    field: 'cashback',
                    title: '注册返现',
                    formatter: function (value, row, index) {
                        return value / 100;
                    }
                },
                {
                    field: 'addTime',
                    title: '添加时间'
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>